import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main'
import Index from '../views/Index'
import Classify from '../views/Classify';
import Surprise from "../views/Surprise";
import ShopCard from '../views/ShopCard';
import My from "../views/My";
import Login from '../views/Login'
import Details from '../views/Details'
Vue.use(VueRouter)

const routes = [
  {
        path: '/',
        name: 'Main',
        component: Main,
    children:[
      {
        path:'/Index',
        name:'Index',
        component:Index
      },
      {
        path:'/Classify',
        name:'Classify',
        component:Classify,

      },
      {
        path:'/ShopCard',
        name:'ShopCard',
        component:ShopCard
      },
      {
        path:'/My',
        name:'My',
        component:My
      }

    ],
    redirect: '/Index'
  },
  {
    path: '/Login',
    name: 'Login',
    component:Login
  },
  {
    path:'/Surprise',
    name:'Surprise',
    component:Surprise
  },
  {
    path:'/Details/:index',
    name:'Details',
    component:Details
  }
]

const router = new VueRouter({
  routes,
  mode:'history'
})
router.push('/index');
export default router
